from pathlib import Path
from tkinter import Tk, filedialog

f = Path(filedialog.askopenfilename(title="Select file..."))
folderpath = Path(r'C:\Users\lenovo\Desktop\中级英语读写2024')
for file in folderpath.glob('*.doc'):
    stem = file.stem
    new_name = f'DOC_{stem}.doc'
    new_filepath = f.parent
    new_filepath=f.name
    f.rename(new_filepath)